 
  var os="android";
if (/ipad|iphone|mac/i.test(navigator.userAgent)){
	os="ios";		
}
 
var soundplayer=new Audio();
soundplayer.src="/static/neworder.mp3";
soundplayer.preload="auto";
soundplayer.volume=1;
var isforce=false;
soundplayer.oncanplay=function(){
				isforce=true;
};
var neworder=false;
function forceSafariPlayAudio() {
		if(os!="ios") return false;
		if(isforce) return false;
			
			if(neworder){
				soundplayer.load();
				soundplayer.play();
				isforce=true;
			}else{
		   		soundplayer.load();
			}
		   
}
window.addEventListener('touchstart', forceSafariPlayAudio, false);

function refreshOrder(){
	$.get("/ymdianadmin.php?m=ymdian_order&a=newjs&t="+new Date(),function(data){
			if(data.success==1){
				soundplayer.play();
				neworder=true;
			}else{
				neworder=false;
			}
		},"json")
	setTimeout(function(){
			refreshOrder();
		},30000);	
}
	$(function(){
		refreshOrder();
	});
 